//
//  ShoppingGoods.m
//  EJLX
//
//  Created by adc on 15/11/18.
//  Copyright © 2015年 江苏一键联信息科技有限公司. All rights reserved.
//

#import "ShoppingGoods.h"

@implementation ShoppingGoods


+(ShoppingGoods *)prasePublicNoticeWithDictionary:(NSDictionary *)dict{
    
    ShoppingGoods *goods = [[ShoppingGoods alloc] init];
    goods.goodsName = dict[@"name"];
    
    goods.topImgUrl = dict[@"topAd"][@"picture"];
    NSDictionary *top = dict[@"topAd"][@"product"];
    goods.topName = top[@"name"];
    
    goods.topOldPrice = [top[@"discountPrice"] intValue];
    goods.topNewPrice = [top[@"price"]intValue];
    goods.topID = [top[@"id"]intValue];
    
    goods.leftImgUrl= dict[@"leftAd"][@"picture"];
    NSDictionary *left = dict[@"leftAd"][@"product"];
    goods.leftName = left[@"name"];
    goods.leftOldPrice= [left[@"discountPrice"]intValue];
    goods.leftNewPrice = [left[@"price"]intValue];
      goods.leftID = [left[@"id"]intValue];
    
    
    goods.rightImgUrl= dict[@"rightAd"][@"picture"];
    NSDictionary *right = dict[@"rightAd"][@"product"];
    goods.rightName = right[@"name"];
    goods.rightOldPrice= [right[@"discountPrice"]intValue];
    goods.rightNewPrice = [right[@"price"]intValue];
    goods.rightID = [right[@"id"]intValue];
    
    return goods;
    
}
@end
